<%@ page language="java" import="java.util.*" pageEncoding="utf-8" import="pojo.*,base.*,service.*,java.text.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <style type="text/css">
#list {
           margin-bottom:10px
}
#all a {
           text-decoration:none;
           color:black;
           }

#all a:link,.toptext a:visited{color:black;}
#all a:hover{color:#A020F0;}  
     body{
	margin:0;
	padding:40px;
	background-image:url("images/bj.jpg");
	background-repeat:no-repeat;
	font:100% Arial, Helvetica, sans-serif;
	color:#555;
	line-height:100%;
}  
 .STYLE1 {font-size: 100%}
 </style>

 <script type="text/javascript" src="jquery/jquery-1.7.2.min.js"></script>
 <script>
 function deleteTableType(url){
  if(deleteconfirm()){
  location.href=url;
  }
 }
 function deleteconfirm(){
	if(confirm("确认要删除数据吗"))
		return true;
	return false;
 }

 </script>

  </head>
  
  <body>
   <div id="all">
   <div align="right"><a href="AddTableType.jsp" title="添加类别" class="STYLE1">添加类别 </a></div>;
<div id="list">
<%
	
    
    TableService dts = new TableService();
   	List<TableType> list = dts.getTableType();		
%>
  
</div>
<br/>
<center>
	<table width="500" border="1">
      <tr>
        <td width="100"><div align="center">类型id号</div></td>
        <td width="100"><div align="center">类型名</div></td>
        <td width="100"><div align="center"> 操作</div></td>
      </tr>
<%

		
	for (TableType inf : list) {
	out.println("<tr><td><div align='center'>"+inf.getId()+"</div></td>");
	out.println("<td><div align='center'>"+inf.getName()+"</div></td>");
	%>
	<%
	out.println("<td><div align='center'><a href='updateTableType.jsp?id="+inf.getId()+"'>修改 </a><input type='button' onclick=deleteTableType('action/deleteTableType.jsp?id="+inf.getId()+"'); value='删除'/></div></td></tr>");
	}
	
%>
	
</table>
  </center>
	  </div>
	  
  </body>
</html>
